<?php
if(!isset($model)) 
	$model = new UserLogin();

$this->pageTitle=Yii::app()->name . ' - '.Yii::t("UserModule.user", "Login");
$this->breadcrumbs=array(
	Yii::t("UserModule.user", "Login"),
);
?>

<h1><?php echo Yii::t("UserModule.user", "Login"); ?></h1>

<?php if(Yii::app()->user->hasFlash('loginMessage')): ?>

<div class="success">
	<?php echo Yii::app()->user->getFlash('loginMessage'); ?>
</div>

<?php endif; ?>

<div class="form">
    <fieldset>
    <table>
        <tr>
            <td>
                <?php echo CHtml::beginForm(); ?>
                <p class="note">Fields with <span class="required">*</span> are required.</p>
                <?php echo CHtml::errorSummary($model); ?>

                <div class="row">
                    <?php echo CHtml::activeLabelEx($model,'username'); ?>
                    <?php echo CHtml::activeTextField($model,'username') ?><br />
                </div>

                <div class="row">
                    <?php echo CHtml::activeLabelEx($model,'password'); ?>
                    <?php echo CHtml::activePasswordField($model,'password') ?><br />
                </div>

                <div class="row rememberMe">
                    <?php echo CHtml::activeCheckBox($model,'rememberMe'); ?>
                    <?php echo CHtml::activeLabel($model,'rememberMe'); ?><br />
                </div>

                <div class="row submit">
                    <?php echo CHtml::submitButton('Login'); ?>
                </div>

                <?php echo CHtml::endForm(); ?>
            </td>
            <td>
                <?php echo CHtml::image('images/key2.png','logo',array('height'=>'200px'))?>
            </td>
        </tr>
    </table>

</fieldset>
</div><!-- form -->


<?php
$form = new CForm(array(
    'elements'=>array(
        'username'=>array(
            'type'=>'text',
            'maxlength'=>32,
        ),
        'password'=>array(
            'type'=>'password',
            'maxlength'=>32,
        ),
        'rememberMe'=>array(
            'type'=>'checkbox',
        )
    ),

    'buttons'=>array(
        'login'=>array(
            'type'=>'submit',
            'label'=>'Login',
        ),
    ),
), $model);
?>
